<?php

/**
 * Laravel-admin - admin builder based on Laravel.
 * @author z-song <https://github.com/z-song>
 *
 * Bootstraper for Admin.
 *
 * Here you can remove builtin form field:
 * Encore\Admin\Form::forget(['map', 'editor']);
 *
 * Or extend custom form field:
 * Encore\Admin\Form::extend('php', PHPEditor::class);
 *
 * Or require js and css assets:
 * Admin::css('/packages/prettydocs/css/styles.css');
 * Admin::js('/packages/prettydocs/js/main.js');
 *
 */

Encore\Admin\Form::forget(['map', 'editor']);
use Encore\Admin\Facades\Admin;
use Encore\Admin\Form;
use \Encore\Admin\Grid\Column;
use \App\Admin\Extensions\Column\Modalinfo;
use \App\Admin\Extensions\Column\Popover;
use \App\Admin\Extensions\Column\User\Gender;
use \App\Admin\Extensions\Column\User\Parentinfo;
//Admin::disablePjax();

//Show::extend('unserialize', Info::class);

//Show::extend('unserialize', UnSerialize::class);
//\Encore\Admin\Grid::extend('info', Info::class);

Column::extend('gender', Gender::class);
Column::extend('parentinfo', Parentinfo::class);
Column::extend('popover', Popover::class);
Column::extend('modalinfo', Modalinfo::class);


Encore\Admin\Form::init(function (Form $form) {

    $form->disableEditingCheck();

    $form->disableCreatingCheck();

    $form->disableViewCheck();

    $form->tools(function (Form\Tools $tools) {
        $tools->disableDelete();
        $tools->disableView();
//        $tools->disableList();
    });

    $form->footer(function ($footer) {

        // 去掉`重置`按钮
//        $footer->disableReset();

        // 去掉`提交`按钮
//        $footer->disableSubmit();

        // 去掉`查看`checkbox
//        $footer->disableViewCheck();
//
//        // 去掉`继续编辑`checkbox
//        $footer->disableEditingCheck();

        // 去掉`继续创建`checkbox
//        $footer->disableCreatingCheck();

    });
});
